let jwt = require('jsonwebtoken');
module.exports = async function (token, SECRET) {
    return new Promise((resolve, reject) => {
        try {
            let info = jwt.verify(token.split(' ')[1], SECRET);
            resolve(info);
        } catch(e) {
            reject(e);
        }
    })
}